package com.xdap.fsapproval.controller;


import com.definesys.mpaas.common.http.Response;
import com.xdap.common.pojo.dto.webhook.XdapProcInstanceDto;
import com.xdap.fsapproval.service.AsagelApprovalService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/custom/asagel/feishu")
public class ApprovalController {

    @Autowired
    private AsagelApprovalService asagelApprovalService;


    @PostMapping("/defineApproval")
    @ApiOperation(value = "审批创建", notes = "审批创建", httpMethod = "POST")
    public Response defineApproval(@RequestBody XdapProcInstanceDto xdapProcInstanceDto){
       return Response.ok().data(asagelApprovalService.defineApproval(xdapProcInstanceDto));
    }

}
